From: Sebastian Wick Date: Mon, 8 Sep 2025 11:19:21 +0000 (+0200) Subject: brightnessManager: Handle absence of brightness control in _sync X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~95^2^2~28 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8a810be11d028b8b5fe6a3b6d196d5048cfb6673;p=gnome-shell.git brightnessManager: Handle absence of brightness control in _sync We already call _sync in response to dimming changes, which might happen no matter if we actually do have control over the brightness. Let's just embrace _sync getting called in any situation and handle that state gracefully by simply returning early. If we re-gain control, _sync will be called again and the updated state becomes active. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8648 Part-of: --- diff --git a/js/misc/brightnessManager.js b/js/misc/brightnessManager.js index 23cd147d7..71f903763 100644 --- a/js/misc/brightnessManager.js +++ b/js/misc/brightnessManager.js @@ -175,13 +175,14 @@ export const BrightnessManager = GObject.registerClass({ }); } - if (this._globalScale) - this._sync({showOSD: false}); + this._sync({showOSD: false}); this.emit('changed'); } _sync({showOSD = true} = {}) { + if (!this._globalScale) + return; if (this._inhibitUpdates) return; this._inhibitUpdates = true;